<template>
    <el-form-item label="投放方式" :prop="`delivery.smart_bid_type`" style="margin-bottom:0">
        <div class="flexbox flexcenter">
            <el-radio-group v-model="createform.delivery.smart_bid_type" class="create_radio" @change="changeSmartType">
                <el-radio label="SMART_BID_CUSTOM">
                    <div class="flexbox flexjust flexcolumn launch_type">
                        <img src="../../../assets/img/market_checked.svg" alt="" class="conversion_check">
                        <div class="launch_name">控制成本投放</div>
                        <div class="launch_text">控制成本，尽量消耗预算</div>
                    </div>
                </el-radio>
                <el-radio label="SMART_BID_CONSERVATIVE" :disabled="createform.lab_ad_type=='LAB_AD'">
                    <div class="flexbox flexjust flexcolumn launch_type">
                        <img src="../../../assets/img/market_checked.svg" alt="" class="conversion_check">
                        <div class="launch_name">放量投放</div>
                        <div class="launch_text">尽量消耗更多预算，接受成本上浮</div>
                    </div>
                </el-radio>
            </el-radio-group>
        </div>
    </el-form-item>
</template>

<script>
export default {
    props:["createform"],
    name: "",
    data() {
        return {};
    },
    created() {},
    methods: {
        sessionSave(){
            this.$emit("sessionSave")
        },

        changePlanKey(type,text){
            this.$emit("changePlanKey",type,text)
        },

        // 投放方式
        changeSmartType() {
            if (
                this.createform.delivery.smart_bid_type ==
                "SMART_BID_CONSERVATIVE"
            ) {
                this.createform.delivery.budget_mode = "BUDGET_MODE_DAY";
                this.createform.delivery.cost_control = false;
                this.createform.deep_external_action = "";
            }
            let text =
                this.createform.delivery.smart_bid_type == "SMART_BID_CUSTOM"
                    ? "控制成本投放"
                    : "放量投放";
            this.changePlanKey(1, text);
            this.sessionSave();
        },
    },
    components: {},
};
</script>


<style scoped>
</style>

